﻿using AutoMapper;
using GiaSu.DataAccess.Entity;
using GiaSu.DataAccess.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GiaSu.Bussiness.Business.Implement
{
    public class GradeBusinessImpl : IGradeBusiness
    {
        private readonly IGenericRepository<Grade> gradeRepository;
        public GradeBusinessImpl(IGenericRepository<Grade> gradeRepository)
        {
            this.gradeRepository = gradeRepository;
        }
        public IList<Grade> GetAll()
        {
            return Mapper.Map<List<Grade>, List<Grade>>(this.gradeRepository.GetAll().ToList());
        }

        public Grade GetById(int id)
        {
            return this.gradeRepository.FindBy(m => m.Id == id).FirstOrDefault();
        }
       

    }
}
